
const Service = require('egg').Service;

class UserService extends Service {
    async findByUsername(username) {
        return await this.ctx.model.User.find({
            username
        })

    }

    async save(user) {
        return await this.ctx.model.User.create(user)
    }

    async fetchList(){
        return await this.ctx.model.User.find({})
    }

}

module.exports = UserService